|
In computer science, region-based memory management is a type of memory management in which each allocated object is assigned to a region. A region, also called a zone, arena, area, or memory context, is a collection of allocated objects that can be efficiently deallocated all at once. Like stack allocation, regions facilitate allocation and deallocation of memory with low overhead; but they are more flexible, allowing objects to live longer than the stack frame in which they were allocated. In typical implementations, all objects in a region are allocated in a single contiguous range of memory addresses, similarly to how stack frames are typically allocated. == Example == As a simple example, consider the following C code which allocates and then deallocates a linked list data structure: Region *r = createRegion(); ListNode *head = NULL; for (int i = 1; i <= 1000; i++) // ... // (use list here) // ... destroyRegion(r); Although it required many operations to construct the linked list, it can be destroyed quickly in a single operation by destroying the region in which the nodes were allocated. There is no need to traverse the list. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Region-based memory management」の詳細全文を読む スポンサード リンク
|